interface innerInterface {
    innerInterface run(String name);   //默认权限为public abstract
}

class innerInterfaceClass implements innerInterface {
    public innerInterface run(String name) {
        System.out.printf("name = %s, interface run.....!\n", name);
        return this;
    }
}

public class FuncInnerTest {
    static int numTest = 1999;

    public static innerInterface test(innerInterface iObj) {
        int num = 10;

        iObj.run("方法里传的参数!");

        class innerClass {
            private String name;

            public innerClass() {
                name = "";
            }

            innerClass(String name) {
                this.name = name;
            }

            innerClass show() {
                System.out.printf("innerClass name = %s, num = %d\n", name, num);
                System.out.printf("numTest = %d\n", numTest);
                return this;
            }
        }

        innerClass obj = new innerClass("hello");

        obj.show();

        return new innerInterface() {
            public innerInterface run(String name) {
                System.out.printf("姓名为: %s, 匿名内部类的作为返回值!\n", name);
                return this;
            }
        };
    }

    public static void main(String [] args) {
        innerInterfaceClass is = new innerInterfaceClass();
        test(new innerInterface() {
            public innerInterface run(String name)  {
                System.out.printf("run的参数:%s, 匿名内部类作为参数\n", name);
                return this;
            }
        }).run("1111").run("2222").run("3333");

        test(is);
        test(is);
    }
}
